QuickTime 4 API Documentation

Programming With QuickTime VR

| Previous | Chapter Contents | Chapter Top | Next |

Handling Events

The QuickTime VR Manager provides a number of routines that you can use to handle user actions such as moving the mouse or clicking the mouse button. Normally, QuickTime VR handles all user interaction internally if your application calls the MCIsPlayerEvent function in its main event loop. For code that does not have a main event loop (such as an OpenDoc part), you might need to override QuickTime VR's mouse event handling.

Most applications do not need to use the functions described in this section.

QTVRGetMouseOverTracking

You can use the QTVRGetMouseOverTracking function to get the current state of mouse-over tracking.

Boolean QTVRGetMouseOverTracking (QTVRInstance qtvr);
qtvr
An instance of a QuickTime VR movie.
function result
A Boolean value that indicates whether QuickTime VR is currently handling mouse-over tracking for the specified movie ( true ) or not ( false ).

DESCRIPTION

The QTVRGetMouseOverTracking function returns, as its function result, a Boolean value that indicates whether QuickTime VR is currently handling mouse-over tracking for the QuickTime VR movie specified by the qtvr parameter ( true ) or not ( false ). By default, QuickTime VR tracks mouse movements in a QuickTime VR movie and changes the shape of the cursor as appropriate.

SEE ALSO

Use QTVRSetMouseOverTracking (next) to change the mouse-over tracking state of a QuickTime VR movie.

QTVRSetMouseOverTracking

You can use the QTVRSetMouseOverTracking function to set the state of mouse-over tracking.

OSErr QTVRSetMouseOverTracking (QTVRInstance qtvr, Booleanenable);
qtvr
An instance of a QuickTime VR movie.
enable
A Boolean value that indicates whether QuickTime VR should handle mouse-over tracking for the specified movie ( true ) or not ( false ).
function result
A result code.

DESCRIPTION

The QTVRSetMouseOverTracking function sets the mouse-over tracking state of the QuickTime VR movie specified by the qtvr parameter to the state specified by the enable parameter. By default, QuickTime VR tracks mouse movements in a QuickTime VR movie and changes the shape of the cursor as appropriate. If you disable mouse-over tracking (by passing false in the enable parameter), you must call the QTVRMouseEnter , QTVRMouseWithin , and QTVRMouseLeave functions at the appropriate times to handle user actions.

SEE ALSO

Use QTVRGetMouseOverTracking to get the current mouse-over tracking state of a QuickTime VR movie.

QTVRMouseEnter

You can use the QTVRMouseEnter function to handle the user's moving the cursor into a QuickTime VR movie for which mouse-over tracking is disabled.

OSErr QTVRMouseEnter (
                     QTVRInstance qtvr,
                     Pointpt,
                     UInt32*hotSpotID,
                     WindowPtr w);
qtvr
An instance of a QuickTime VR movie.
pt
The current location of the cursor, in the local coordinates of the graphics world specified by the w parameter.
hotSpotID
On entry, a pointer to a long integer. On exit, that long integer contains the ID of the hot spot that lies beneath the specified point, or the value 0 if no hot spot lies beneath that point.
w
A pointer to a graphics world.
function result
A result code.

DESCRIPTION

The QTVRMouseEnter function returns, in the long integer pointed to by the hotSpotID parameter, the ID of the hot spot in the QuickTime VR movie specified by the qtvr parameter that lies directly under the point specified by the pt parameter. If no hot spot lies under that point, the long integer is set to 0. QTVRMouseEnter also performs any other tasks that are typically performed when the user first moves the cursor into a QuickTime VR movie.

SPECIAL CONSIDERATIONS

You need to call QTVRMouseEnter only if you have disabled mouse-over tracking for the specified QuickTime VR movie.

SEE ALSO

Use QTVRSetMouseOverTracking to change the mouse-over tracking state of a QuickTime VR movie. Use QTVRMouseWithin (next) and QTVRMouseLeave to handle the cursor's remaining in and leaving a QuickTime VR movie.

QTVRMouseWithin

You can use the QTVRMouseWithin function to handle the user's leaving the cursor in a QuickTime VR movie for which mouse-over tracking is disabled.

OSErr QTVRMouseWithin (QTVRInstance qtvr, Pointpt, UInt32*hotSpotID, WindowPtr w);
qtvr
An instance of a QuickTime VR movie.
pt
The current location of the cursor, in the local coordinates of the graphics world specified by the w parameter.
hotSpotID
On entry, a pointer to a long integer. On exit, that long integer contains the ID of the hot spot that lies beneath the specified point, or the value 0 if no hot spot lies beneath that point.
w
A pointer to a graphics world.
function result
A result code.

DESCRIPTION

The QTVRMouseWithin function returns, in the long integer pointed to by the hotSpotID parameter, the ID of the hot spot in the QuickTime VR movie specified by the qtvr parameter that lies directly under the point specified by the pt parameter. If no hot spot lies under that point, the long integer is set to 0. QTVRMouseWithin also performs any other tasks that are typically performed when the user leaves the cursor in a QuickTime VR movie.

You should call QTVRMouseWithin repeatedly for as long as the cursor remains in the specified QuickTime VR movie.

SPECIAL CONSIDERATIONS

You need to call QTVRMouseWithin only if you have disabled mouse-over tracking for the specified QuickTime VR movie.

SEE ALSO

Use QTVRSetMouseOverTracking to change the mouse-over tracking state of a QuickTime VR movie. Use QTVRMouseEnter and QTVRMouseLeave (next) to handle the cursor's entering and leaving a QuickTime VR movie.

QTVRMouseLeave

You can use the QTVRMouseLeave function to handle the user's moving the cursor out of a QuickTime VR movie for which mouse-over tracking is disabled.

OSErr QTVRMouseLeave (QTVRInstance qtvr, Pointpt, WindowPtr w);
qtvr
An instance of a QuickTime VR movie.
pt
The current location of the cursor, in the local coordinates of the graphics world specified by the w parameter.
w
A pointer to a graphics world.
function result
A result code.

DESCRIPTION

The QTVRMouseLeave function performs any tasks that are typically performed when the user moves the cursor out of a QuickTime VR movie.

SPECIAL CONSIDERATIONS

You need to call QTVRMouseLeave only if you have disabled mouse-over tracking for the specified QuickTime VR movie.

SEE ALSO

Use QTVRSetMouseOverTracking to change the mouse-over tracking state of a QuickTime VR movie. Use QTVRMouseEnter and QTVRMouseWithin to handle the cursor's entering and remaining in a QuickTime VR movie.

QTVRGetMouseDownTracking

You can use the QTVRGetMouseDownTracking function to get the current state of mouse-down tracking.

Boolean QTVRGetMouseDownTracking (QTVRInstanceqtvr);
qtvr
An instance of a QuickTime VR movie.
function result
A Boolean value that indicates whether QuickTime VR is currently handling mouse-down tracking for the specified movie ( true ) or not ( false ).

DESCRIPTION

The QTVRGetMouseDownTracking function returns, as its function result, a Boolean value that indicates whether QuickTime VR is currently handling mouse-down tracking for the QuickTime VR movie specified by the qtvr parameter ( true ) or not ( false ). By default, QuickTime VR tracks mouse clicks in a QuickTime VR movie and triggers hot spots as necessary.

SEE ALSO

Use QTVRSetMouseDownTracking (next) to change the mouse-down tracking state of a QuickTime VR movie.

QTVRSetMouseDownTracking

You can use the QTVRSetMouseDownTracking function to set the state of mouse-down tracking.

OSErr QTVRSetMouseDownTracking (QTVRInstance qtvr, Booleanenable);
qtvr
An instance of a QuickTime VR movie.
enable
A Boolean value that indicates whether QuickTime VR should handle mouse-down tracking for the specified movie ( true ) or not ( false ).
function result
A result code.

DESCRIPTION

The QTVRSetMouseDownTracking function sets the mouse-down tracking state of the QuickTime VR movie specified by the qtvr parameter to the state specified by the enable parameter. By default, QuickTime VR tracks mouse clicks in a QuickTime VR movie and triggers hot spots as appropriate. If you disable mouse-down tracking (by passing false in the enable parameter), you must call the QTVRMouseDown , QTVRMouseStillDown , and QTVRMouseUp functions at the appropriate times to handle user actions.

SEE ALSO

Use QTVRGetMouseDownTracking to get the current mouse-down tracking state of a QuickTime VR movie.

QTVRMouseDown

You can use the QTVRMouseDown function to handle the user's clicking the mouse button when the cursor is in a QuickTime VR movie for which mouse-down tracking is disabled.

OSErr QTVRMouseDown (QTVRInstanceqtvr,
                     Pointpt,
                     UInt32 when,
                     UInt16 modifiers,
                     UInt32*hotSpotID,
                     WindowPtr w);
qtvr
An instance of a QuickTime VR movie.
pt
The current location of the cursor, in the local coordinates of the graphics world specified by the w parameter.
when
The time, in the number of ticks since system startup, when the mouse-down event was posted.
modifiers
A short integer that contains information about the state of the modifier keys and the mouse button at the time the event was posted. See the chapter "Event Manager" in Inside Macintosh: Macintosh Toolbox Essentials for a description of the information encoded in this parameter.
hotSpotID
On entry, a pointer to a long integer. On exit, that long integer contains the ID of the hot spot that lies beneath the specified point, or the value 0 if no hot spot lies beneath that point.
w
A pointer to a graphics world.
function result
A result code.

DESCRIPTION

The QTVRMouseDown function returns, in the long integer pointed to by the hotSpotID parameter, the ID of the hot spot in the QuickTime VR movie specified by the qtvr parameter that lies directly under the point specified by the pt parameter. If no hot spot lies under that point, the long integer is set to 0. QTVRMouseDown also performs any other tasks that are typically performed when the user clicks the mouse button when the cursor is in a QuickTime VR movie.

SPECIAL CONSIDERATIONS

You need to call QTVRMouseDown only if you have disabled mouse-down tracking for the specified QuickTime VR movie.

SEE ALSO

Use QTVRSetMouseDownTracking to change the mouse-down tracking state of a QuickTime VR movie. Use QTVRMouseUp and QTVRMouseStillDown (next) to handle the mouse button's being held down and released.

QTVRMouseStillDown

You can use the QTVRMouseStillDown function to handle the user's holding down the mouse button while the cursor is in a QuickTime VR movie for which mouse-down tracking is disabled.

Applications running on operating systems other than Mac OS should use the extended form of this function: see "QTVRMouseStillDownExtended" .

OSErr QTVRMouseStillDown (
                     QTVRInstanceqtvr,
                     Pointpt,
                     UInt32*hotSpotID,
                     WindowPtr w);
qtvr
An instance of a QuickTime VR movie.
pt
The current location of the cursor, in the local coordinates of the graphics world specified by the w parameter.
hotSpotID
On entry, a pointer to a long integer. On exit, that long integer contains the ID of the hot spot that lies beneath the specified point, or the value 0 if no hot spot lies beneath that point.
w
A pointer to a graphics world.
function result
A result code.

DESCRIPTION

The QTVRMouseStillDown function returns, in the long integer pointed to by the hotSpotID parameter, the ID of the hot spot in the QuickTime VR movie specified by the qtvr parameter that lies directly under the point specified by the pt parameter. If no hot spot lies under that point, the long integer is set to 0. QTVRMouseStillDown also performs any other tasks that are typically performed when the user holds down the mouse button when the cursor is in a QuickTime VR movie.

You should call QTVRMouseStillDown repeatedly for as long as the user holds down the mouse button while the cursor is in the specified QuickTime VR movie.

SPECIAL CONSIDERATIONS

You need to call QTVRMouseStillDown only if you have disabled mouse-down tracking for the specified QuickTime VR movie.

SEE ALSO

Use QTVRSetMouseDownTracking to change the mouse-down tracking state of a QuickTime VR movie. Use QTVRMouseDown and QTVRMouseUp (next) to handle the mouse button's being clicked and released.

QTVRMouseUp

You can use the QTVRMouseUp function to handle the user's releasing the mouse button while the cursor is in a QuickTime VR movie for which mouse-down tracking is disabled.

Applications running on operating systems other than Mac OS should use the extended form of this function: see "QTVRMouseUpExtended" .

OSErr QTVRMouseUp (QTVRInstance qtvr, Pointpt, UInt32*hotSpotID, WindowPtr w);
qtvr
An instance of a QuickTime VR movie.
pt
The current location of the cursor, in the local coordinates of the graphics world specified by the w parameter.
hotSpotID
On entry, a pointer to a long integer. On exit, that long integer contains the ID of the hot spot that lies beneath the specified point, or the value 0 if no hot spot lies beneath that point.
w
A pointer to a graphics world.
function result
A result code.

DESCRIPTION

The QTVRMouseUp function returns, in the long integer pointed to by the hotSpotID parameter, the ID of the hot spot in the QuickTime VR movie specified by the qtvr parameter that lies directly under the point specified by the pt parameter. If no hot spot lies under that point, the long integer is set to 0. QTVRMouseUp also performs any other tasks that are typically performed when the user releases the mouse button after clicking it when the cursor is in a QuickTime VR movie.

SPECIAL CONSIDERATIONS

You need to call QTVRMouseUp only if you have disabled mouse-down tracking for the specified QuickTime VR movie.

SEE ALSO

Use QTVRSetMouseDownTracking to change the mouse-down tracking state of a QuickTime VR movie. Use QTVRMouseDown and QTVRMouseStillDown to handle the mouse button's being clicked and held down.

QTVRMouseStillDownExtended

You can use the QTVRMouseStillDownExtended function the same way you use the QTVRMouseStillDown function, to handle the user's holding down the mouse button while the cursor is in a QuickTime VR movie for which mouse-down tracking is disabled.

The QTVRMouseStillDownExtended function uses the same intercept as the QTVRMouseStillDown function but has two additional parameters. Applications that intercept kQTVRMouseStillDownExtended should always check the paramCount field to make sure it is 5 before using the last two fields.

Internally, QuickTime VR always uses the QTVRMouseStillDownExtended function instead of QTVRMouseStillDown . Developers implementing their own mouse down tracking don't need to use the extended version unless they also intercept the procedure and need the added parameters.

OSErr QTVRMouseStillDownExtended (
                     QTVRInstanceqtvr,
                     Pointpt,
                     UInt32*hotSpotID,
                     WindowPtr w,
                     UInt32 when,
                     UInt16 modifiers);
qtvr
An instance of a QuickTime VR movie.
pt
The current location of the cursor, in the local coordinates of the graphics world specified by the w parameter.
hotSpotID
On entry, a pointer to a long integer. On exit, that long integer contains the ID of the hot spot that lies beneath the specified point, or the value 0 if no hot spot lies beneath that point.
w
A pointer to a graphics world.
when
The current time, in the number of ticks since system startup, obtained by a call to TickCount() .
modifiers
A short integer that contains information about the state of the modifier keys and the mouse button at the current time. See the chapter "Event Manager" in Inside Macintosh: Macintosh Toolbox Essentials for a description of the information encoded in this parameter.
function result
A result code.

DESCRIPTION

The QTVRMouseStillDownExtended function returns, in the long integer pointed to by the hotSpotID parameter, the ID of the hot spot in the QuickTime VR movie specified by the qtvr parameter that lies directly under the point specified by the pt parameter. If no hot spot lies under that point, the long integer is set to 0. QTVRMouseStillDownExtended also performs any other tasks that are typically performed when the user holds down the mouse button when the cursor is in a QuickTime VR movie.

You should call QTVRMouseStillDownExtended repeatedly for as long as the user holds down the mouse button while the cursor is in the specified QuickTime VR movie.

SPECIAL CONSIDERATIONS

You need to call QTVRMouseStillDownExtended only if you have disabled mouse-down tracking for the specified QuickTime VR movie.

SEE ALSO

Use QTVRSetMouseDownTracking to change the mouse-down tracking state of a QuickTime VR movie. Use QTVRMouseDown and QTVRMouseUpExtended (next) to handle the mouse button's being clicked and released.

QTVRMouseUpExtended

You can use the QTVRMouseUpExtended function the same way you use the QTVRMouseUp function, to handle the user's releasing the mouse button while the cursor is in a QuickTime VR movie for which mouse-down tracking is disabled.

The QTVRMouseUpExtended function uses the same intercept as the QTVRMouseUp function but has two additional parameters. Applications that intercept QTVRMouseUpExtended should always check the paramCount field to make sure it is 5 before using the last two fields.

Internally, QuickTime VR always uses the QTVRMouseUpExtended function instead of QTVRMouseUp . Developers implementing their own mouse down tracking don't need to use the extended version unless they also intercept the procedure and need the added parameters.

OSErr QTVRMouseUpExtended (
                     QTVRInstance qtvr,
                     Pointpt,
                     UInt32*hotSpotID,
                     WindowPtr w,
                     UInt32 when,
                     UInt16 modifiers);
qtvr
An instance of a QuickTime VR movie.
pt
The current location of the cursor, in the local coordinates of the graphics world specified by the w parameter.
hotSpotID
On entry, a pointer to a long integer. On exit, that long integer contains the ID of the hot spot that lies beneath the specified point, or the value 0 if no hot spot lies beneath that point.
w
A pointer to a graphics world.
when
The time, in the number of ticks since system startup, when the mouse-up event was posted.
modifiers
A short integer that contains information about the state of the modifier keys and the mouse button at the time the event was posted. See the chapter "Event Manager" in Inside Macintosh: Macintosh Toolbox Essentials for a description of the information encoded in this parameter.
function result
A result code.

DESCRIPTION

The QTVRMouseUpExtended function returns, in the long integer pointed to by the hotSpotID parameter, the ID of the hot spot in the QuickTime VR movie specified by the qtvr parameter that lies directly under the point specified by the pt parameter. If no hot spot lies under that point, the long integer is set to 0. QTVRMouseUpExtended also performs any other tasks that are typically performed when the user releases the mouse button after clicking it when the cursor is in a QuickTime VR movie.

SPECIAL CONSIDERATIONS

You need to call QTVRMouseUp or QTVRMouseUpExtended only if you have disabled mouse-down tracking for the specified QuickTime VR movie.


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |